<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Echarts测试</title>
    <script src="../../js/echarts.js" type="text/javascript"></script>
    <script src="../../js/jquery-3.2.1.min.js" type="text/javascript"></script>
    </meta>
</head>
<body>
<div id="container" style="width:800px;height:800px;"></div>
<script type="text/javascript">
    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};
    $.ajax({
        "url": "http://192.168.1.185:8086/bweixin/v1.0/bigData/queryOrgRelation",
        "type": "post",
        "data": JSON.stringify({
            "companyName": "广东省中科进出口有限公司"
        }),
        "contentType": "application/json",
        "dataType": "json",
        "success": function (data) {
            option = {
                title: {
                    text: 'Graph 简单示例'
                },
                tooltip: {},
                animationDurationUpdate: 1500,
                animationEasingUpdate: 'quinticInOut',
                series: [
                    {
                        type: 'graph',
                        layout: 'none',
                        symbolSize: 50,
                        roam: true,
                        label: {
                            normal: {
                                show: true
                            }
                        },
                        edgeSymbol: ['circle', 'arrow'],
                        edgeSymbolSize: [4, 10],
                        edgeLabel: {
                            normal: {
                                textStyle: {
                                    fontSize: 20
                                }
                            }
                        },
                        data: data.data,
                        // links: [],
                        links: data.links,
                        lineStyle: {
                            normal: {
                                opacity: 0.9,
                                width: 2,
                                curveness: 0
                            }
                        }
                    }
                ]
            };
            if (option && typeof option === "object") {
                myChart.setOption(option, true);
            }
        }
    });
</script>
</body>
</html>